# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Storage.V1.Model.BucketIamConfiguration do
  @moduledoc """
  The bucket's IAM configuration.

  ## Attributes

  *   `bucketPolicyOnly` (*type:* `GoogleApi.Storage.V1.Model.BucketIamConfigurationBucketPolicyOnly.t`, *default:* `nil`) - The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.
  *   `publicAccessPrevention` (*type:* `String.t`, *default:* `nil`) - The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported.
  *   `uniformBucketLevelAccess` (*type:* `GoogleApi.Storage.V1.Model.BucketIamConfigurationUniformBucketLevelAccess.t`, *default:* `nil`) - The bucket's uniform bucket-level access configuration.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bucketPolicyOnly =>
            GoogleApi.Storage.V1.Model.BucketIamConfigurationBucketPolicyOnly.t() | nil,
          :publicAccessPrevention => String.t() | nil,
          :uniformBucketLevelAccess =>
            GoogleApi.Storage.V1.Model.BucketIamConfigurationUniformBucketLevelAccess.t() | nil
        }

  field(:bucketPolicyOnly, as: GoogleApi.Storage.V1.Model.BucketIamConfigurationBucketPolicyOnly)
  field(:publicAccessPrevention)

  field(:uniformBucketLevelAccess,
    as: GoogleApi.Storage.V1.Model.BucketIamConfigurationUniformBucketLevelAccess
  )
end

defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.BucketIamConfiguration do
  def decode(value, options) do
    GoogleApi.Storage.V1.Model.BucketIamConfiguration.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.BucketIamConfiguration do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
